<?xml version='1.0' encoding='UTF-8' ?>
<!--

    Copyright (c) 2014, 2019 Oracle and/or its affiliates. All rights reserved.

    This program and the accompanying materials are made available under the
    terms of the Eclipse Distribution License v. 1.0, which is available at
    http://www.eclipse.org/org/documents/edl-v10.php.

    SPDX-License-Identifier: BSD-3-Clause

-->

<ui:composition xmlns="http://www.w3.org/1999/xhtml"
                xmlns:h="http://xmlns.jcp.org/jsf/html"
                xmlns:ui="http://xmlns.jcp.org/jsf/facelets">

    <h:form rendered="#{userController.logged == false}">
        
        <h:outputLabel for="username" value="#{bundle.Topbar_User_Label}" />
        <h:inputText id="username" value="#{userController.username}" size="50" />
        <h:outputLabel for="password" value="#{bundle.Topbar_Pass_Label}" />
        <h:inputSecret id="password" value="#{userController.password}" size="50" />

        <h:commandButton action="#{userController.login}"  value="#{bundle.Topbar_Login_Label}" /> 
        <h:commandButton action="customer/Create.xhtml"  value="#{bundle.Topbar_Signup_Label}" />
        <h:outputLink value="/dukes-store/" >${bundle.GoToStore}</h:outputLink>
    </h:form>
    <h:form rendered="#{userController.logged}">
        <h:commandButton action="#{userController.logout}" immediate="true" value="#{bundle.Topbar_Logout_Label}"/>
            <h:outputText value=" #{bundle.Topbar_User_Label} #{userController.authenticatedUser.email}"  styleClass="user"/>
        <h:outputLink value="/dukes-store/admin/" >${bundle.GoToStore}</h:outputLink>
    </h:form>
    
</ui:composition>
